<!doctype html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>基于SVG的jQuery评分插件-jRate|DEMO_jQuery之家-自由分享jQuery、html5、css3的插件库</title>
	<link rel="stylesheet" type="text/css" href="css/normalize.css" />
	<link rel="stylesheet" type="text/css" href="css/default.css">
	<style type="text/css">
		.main{
			width: 20em;
			margin: 0 auto;
		}
		.rate-wrapper{width: 100%;height: 150px;}
		.jRate{
			width: 200px;
			height: 50px;
		}
	</style>
	<!--[if IE]>
		<script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	<![endif]-->
</head>
<body>
	<div class="container">
		<header class="htmleaf-header">
			<h1>基于SVG的jQuery评分插件-jRate <span>A SVG based Rating jQuery plugin</span></h1>
			<div class="htmleaf-links">
				<a class="htmleaf-icon icon-home" href="http://www.htmleaf.com/" title="jQuery之家" target="_blank"><span> jQuery之家</span></a>
				<a class="htmleaf-icon icon-arrow-right3" href="http://www.htmleaf.com/jQuery/Rating-Star-Rating/201501221245.html" title="返回下载页" target="_blank"><span> 返回下载页</span></a>
			</div>
		</header>
		<div class="content bgcolor-8">
			<div class="main">
				<div class="rate-wrapper">
					<div id="jRate" class="jRate"></div>
				</div>
				<div class="rate-wrapper">
					<div id="jRate2" class="jRate"></div>
				</div>
			</div>
		</div>
	</div>
	
	<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
	<script src="js/jRate.min.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function () {
			var that = this;
			$("#jRate").jRate({
				rating: 3,
				strokeColor: 'black',
				width: 80,
				height: 80,
				startColor: "cyan",
				endColor: "blue",
				onChange: function(rating) {
					console.log("OnChange: Rating: "+rating);
				},
				onSet: function(rating) {
					console.log("OnSet: Rating: "+rating);
				}
			});
			$('#jRate2').jRate({
				rating:2,
				shape:'RHOMBUS',
				strokeColor: 'white',
				width:50,
				height:50,
  				opacity: 0.3,
  				shapeGap:'10px',
  				reverse: true
			});
		});
	</script>
</body>
</html>